home *** CD-ROM | disk | FTP | other *** search
- # error - tells you what the bsh error numbers mean; you can also use it
- # with AmigaDOS error numbers - it just calls Fault with the number you pass.
- #
- # Error is presented as is; no warrantee is either expressed or implied
- # as to it's suitability to any purpose whatsoever. You assume all the
- # risk for all damage, even if caused by a defect in the software,
- # no matter how awful.
- if !?argv[1]
- echo >&2 usage: error num
- return 10
- elseif !numeric(argv[1])
- echo >&2 usage: error num
- return 10
- endif
- if argv[1] < 900
- Fault $1
- return
- endif
- local IFS="\n" errs m=argv[1]-900
-
- set errs `cat << +`
- insufficient arguments
- no such label
- must be in script file
- syntax error
- redirection error
- name too long
- attempt to mv a directory inside itself
- destination not a directory
- attempt to mv a volume or device
- undefined variable
- if nesting limit exceeded
- ambiguous
- no match
- bad while/if nesting
- no corresponding while
- missing endif
- missing endwhile
- no corresponding if
- attempt to overwrite file
- unable to append to file
- divide by zero
- subscript out of range
- subscript required with array
- unknown command
- cannot nest foreach command
- command not allowed within foreach
- there is no error 926
- EOF
- can't open file or library
- execute permission denied
- operator/operand stack overflow
- wildcard pattern too complex
- script recursion limit exceeded
- missing parenthesis
- While nesting limit exceeded
- Alias recursion limit exceeded
- Stack overflow
- operand not numeric
- insufficient arguments
- +
-
- if m >= #errs
- echo unknown error: $1
- else
- echo error $1: $errs[$m]
- endif
-